# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *

from usuarios.views import auth_direct_to_template
from usuarios.views import auth_gridcrud_run

from sgr.gridcrud import RecursoGridCrud


urlpatterns = patterns('',
    url(r'^$', auth_direct_to_template, {'template': 'sgr/recurso/recurso_list.html'}, name='recurso.listar'),
    url(r'^listar/$', auth_gridcrud_run, {'klass': RecursoGridCrud, 'func': 'list'}, name='recurso.listar.grid'),
    url(r'^novo/$', auth_gridcrud_run, {'klass': RecursoGridCrud, 'func': 'form'}, name='recurso.novo'),
    url(r'^novo/salvar/$', auth_gridcrud_run, {'klass': RecursoGridCrud, 'func': 'form'}, name='recurso.novo.salvar'),
    url(r'^editar/(?P<id>[0-9]+)/$', auth_gridcrud_run, {'klass': RecursoGridCrud, 'func': 'form'}, name='recurso.editar'),
    url(r'^editar/(?P<id>[0-9]+)/salvar/$', auth_gridcrud_run, {'klass': RecursoGridCrud, 'func': 'form'}, name='recurso.editar.salvar'),
    url(r'^deletar/(?P<id>[0-9]+)/$', auth_gridcrud_run, {'klass': RecursoGridCrud, 'func': 'delete'}, name='recurso.deletar'),
)
